import { reactive, ref } from 'vue';
import router from '@/router';

export default function importConfig() {
  const base = reactive<any>({
    user: null,
    activeTab: 1,
  });

  const user = {
    name: 'admin',
    tel: '214234',
    email: '24783@163.com',
    dept: '部门',
    role: '角色',
    createTime: '2000-10-1',
    nick: 'zhangsan',
    sex: '0',
  };

  const infoList = [
    {
      name: '用户名称',
      value: user.name,
      icon: 'icon-user',
    },
    {
      name: '手机号码',
      value: user.tel,
      icon: 'icon-phone',
    },
    {
      name: '用户邮箱',
      value: user.email,
      icon: 'icon-email',
    },
    {
      name: '所属部门',
      value: user.dept,
      icon: 'icon-branch',
    },
    {
      name: '所属角色',
      value: user.role,
      icon: 'icon-user-group',
    },
    {
      name: '创建时间',
      value: user.createTime,
      icon: 'icon-calendar',
    },
  ];

  const init = () => {};

  const tabClick = (key) => {
    base.activeTab = key;
  };

  return {
    base,
    user,
    infoList,
    init,
    tabClick,
  };
}
